﻿<link href="/Style Library/Search.css" rel="stylesheet" type="text/css" />  
<script type="text/javascript" src="/SiteCollectionDocuments/jquery.min.js"></script>
 
    <script type="text/javascript" src="/SiteCollectionDocuments/jquery.SPServices-0.5.4.min.js"></script>
 
    <script type="text/javascript" src="/SiteCollectionDocuments/SPSearch_load.js"></script>
 
 
 
    <script type="text/javascript">
        function clearboxes() {
            document.getElementById("functienaam").value = "";
            document.getElementById("FunctieCode").value = "";
KbWorks.filterfunctions.divname="werkgebied";
KbWorks.filterfunctions.deletelistboxfilter();
KbWorks.filterfunctions.divname="functiestraat";
KbWorks.filterfunctions.deletelistboxfilter();
KbWorks.filterfunctions.divname="functieschaal";
KbWorks.filterfunctions.deletelistboxfilter();
 
        }
             function searchitems() {
            var Listsearch = "FunctieTable";
 
            //create a array of filters.
            //alternatevalue is array
            var alternatevalue = new Array;
            //[columnname,fieldtype,elementname, operator,typeinput,filternumber]
            KbWorks.filterfunctions.filters = new Array
            var i = 0;
            if (document.getElementById("functienaam").value != "") {
                KbWorks.filterfunctions.filteradd("Functienaam", "Text", "functienaam", "Contains", "textbox");
            }
            if (document.getElementById("FunctieCode").value != "") {
                KbWorks.filterfunctions.filteradd("Functiecode", "Text", "FunctieCode", "Contains", "textbox");
            }
            if (document.getElementById("werkgebied").value != "") {
                KbWorks.filterfunctions.filteradd("Werkgebied", "Lookup", "werkgebied", "Contains", "listbox");
            }
            if (document.getElementById("functiestraat").value != "") {
                KbWorks.filterfunctions.filteradd("Functiestraat", "Lookup", "functiestraat", "Contains", "listbox");
            }
            if (document.getElementById("functieschaal").value != "") {
                KbWorks.filterfunctions.filteradd("Functieschaal", "Lookup", "functieschaal", "Contains", "listbox");
            }
            //filters
 
            //fields to view
            //   <ViewFields >
            // [Fieldrefname,kolomname,Hyperlinkname,(ows_) fieldname]
            KbWorks.lists.viewfields = new Array;
            KbWorks.lists.viewfields[0] = ["Functiecode", "Codefunctie"];
            KbWorks.lists.viewfields[1] = ["Functienaam", "functie naam"];
            KbWorks.lists.viewfields[2] = ["Volledige_x0020_functienaam", "Volledige functienaam"];
            KbWorks.lists.viewfields[3] = ["Functieschaal", "Functieschaal"];
            KbWorks.lists.viewfields[4] = ["Werkgebied", "Werkgebied"];
            KbWorks.lists.viewfields[5] = ["Functiestraat", "Functiestraat"];
            KbWorks.lists.viewfields[6] = ["NL_x0020_Profile", "NL Profile", "uitgebreid NL Profile"];
            KbWorks.lists.viewfields[7] = ["EN_x0020_Profile", "EN Profile", "uitgebreid en Profile"];
            //end of viewfields
 
            //
            //set the list server
            KbWorks.lists.weburl = "http://devKbWorks/HR";
            //set the divname
            KbWorks.lists.divname = "searchFeature";
            KbWorks.lists.WithoutFilters = false;
            KbWorks.lists.searchitems(Listsearch);
 
 
        }
 
        $(document).ready(function() {
            KbWorks.lists.weburl = "http://devKbWorks/HR";
            KbWorks.lists.divname = "searchFeature";
            KbWorks.lists.elementtofill = "werkgebied";
            KbWorks.lists.viewfields = new Array;
            KbWorks.lists.viewfields[0] = ["Title", "Title"];
            KbWorks.lists.WithoutFilters = true;
            KbWorks.lists.filters = "";
            KbWorks.lists.searchitems("Werkgebied");
 
            KbWorks.lists.elementtofill = "functiestraat";
            KbWorks.lists.viewfields = new Array;
            KbWorks.lists.viewfields[0] = ["Title", "Title"];
            KbWorks.lists.searchitems("functiestraat");
 
            KbWorks.lists.elementtofill = "functieschaal";
            KbWorks.lists.viewfields = new Array;
            KbWorks.lists.viewfields[0] = ["Title", "Title"];
            KbWorks.lists.searchitems("functieschaal");
 
 
        });
    </script>
    <div id="searchbox">
        <table>
            <tr>
                <td>
                    Functienaam:
                </td>
                <td>
                    <input id="functienaam" />
                </td>
            </tr>
            <tr>
                <td>
                    Functiecode:
                </td>
                <td>
                    <input id="FunctieCode" />
                </td>
            </tr>
            <tr>
                <td>
                    Werkgebied:
                </td>
                <td>
                    <select name="werkgebied" id="werkgebied" size="4" style="width: 100;" multiple="multiple" />
                </td>
            </tr>
            <tr>
                <td>
                    Functiestraat:
                </td>
                <td>
                    <select name="fun ctiestraat" id="functiestraat" size="4" style="width: 100;" multiple="multiple" />
                </td>
            </tr>
            <tr>
                <td>
                    Functieschaal:
                </td>
                <td>
                    <select name="functieschaal" id="functieschaal" size="4" style="width: 100;" multiple="multiple" />
                </td>
            </tr>
            <tr>
                <td>
                    <button id="search" onclick="searchitems()">
                        Zoek</button>
                </td>
                <td>
                    <button id="clear" onclick="clearboxes()">
                        Clear</button>
                </td>
            </tr>
        </table>
        <div id="searchFeature">
            &nbsp;</div>
        <div id="TopFAQ">
        </div>
    </div>
